﻿#include "battery_tilt.h"


// 动力电池倾斜识别

/// <summary>
/// 
/// </summary>
battery_tilt::battery_tilt()
{
	init();
}


/// <summary>
/// 
/// </summary>
battery_tilt::~battery_tilt()
{


}


/// <summary>
/// 
/// </summary>
/// <returns></returns>
void battery_tilt::init()
{

}


/// <summary>
/// 
/// </summary>
/// <param name="pData"></param>
void battery_tilt::execute(QSharedPointer<IMG_DATA> pData, int nBuffersize)
{
	IMG_DATA data = *pData;
	data.image = urlToPixmap(data.strUrl);
	saveImage(data);


	std::vector<DetectResult> results;


	// 返回结果到 kafka 
	_tagResults tagResults;
	tagResults.setImageData(data);
	tagResults.setResults("电池倾斜", results);
	tagResults.setVersion("");

	QString strResultTopc = data.strTopicName + suffix_1;
	QString strResultData = tagResults.toJSon();

	pushKafka(strResultTopc, strResultData, data.strStationId);
}
